package com.second.task;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import com.second.consts.RabbitConst;

import java.util.Map;

@Component
public class SendSecMsgTask {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Async
    public void sendSecMsg(Map<String, Object> args) {
        rabbitTemplate.convertAndSend(RabbitConst.ORD_SEC_DIRECT_EX, RabbitConst.ORD_SEC_QUEUE_RK, args);
    }
}
